import request from '@/utils/request'

// 秒杀活动列表
export const fetchFlashList = (params) => {
    return request({
        url: '/flash/list',
        method: 'get',
        params: params
    })
}

// 更新活动状态
export const updateStatusFlash = (id, params) => {
    return request({
        url: '/flash/update/status/' + id,
        method: 'post',
        params: params
    })
}

// 删除秒杀活动
export const deleteFlash = (id) => {
    return request({
        url: '/flash/delete/' + id,
        method: 'post',
    })
}

// 创建秒杀活动
export const createFlash = (data) => {
    return request({
        url: '/flash/create',
        method: 'post',
        data: data
    })
}

// 更新秒杀活动
export const updateFlash = (id, data) => {
    return request({
        url: '/flash/update/' + id,
        method: 'post',
        data: data
    })
}